﻿using AutoMapper;

namespace GroceryPriceBook.Core.Mappers
{
	/// <summary>
	/// View Model object for presentation which inherits the AutoMapper Profile class
	/// </summary>
	public class ProductAmountUnit : Profile
	{
		public override string ProfileName
		{
			get { return "ProductAmountUnitMappings"; }
		}

		protected override void Configure()
		{
			Mapper.CreateMap<Model.ProductAmountUnit, ViewModel.ProductAmountUnit>();
			Mapper.CreateMap<ViewModel.ProductAmountUnit, Model.ProductAmountUnit>()
				  .ForSourceMember(src => src.Products, opt => opt.Ignore());
		}
	}
}
